package com.jack.leetcode.eachproblem_2020;

public class 反转字符串 {

    public void reverseString(char[] s) {
        int n =s.length;
        for(int i = 0;i < n / 2;i++){
            tran (s, i, n - 1 - i);
        }
    }
    private void tran(char[] s, int l, int r){
        char tmp = s[l];
        s[l] = s[r];
        s[r] = tmp;
    }
}
